'''
Author: 奔跑的乌龟
Date: 2020-12-05 13:25:53
LastEditTime: 2020-12-05 14:44:44
email: 435327238@qq.com
FilePath: \waibaoe:\爬虫12-4\Db.py
'''
import requests
from lxml import etree
import html
import pymysql
import time

def getHtml(url):
    
    try:
        headers = {"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"}
        reponse = requests.get(url,headers=headers)
        #   判断状态码是否为200,
        if (reponse.status_code == 200):
            reponse = reponse
            return reponse
        else:
            return "1"    
        # return None
    except BaseException:
        return None